<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<script>
			var arr = [5, 2, 4, 1, 3];
			console.log(arr[0])
			console.log(arr[1])
			console.log(arr[2])
			console.log(arr[3])
			console.log(arr[4])
			for (var j = 0; j < arr.length - 1; j++) {

				
					if (arr[0] > arr[0 + 1]) {
						var temp = arr[0];
						arr[0] = arr[0 + 1];
						arr[0 + 1] = temp;
					}
					if (arr[1] > arr[1 + 1]) {
						var temp = arr[1];
						arr[1] = arr[1 + 1];
						arr[1 + 1] = temp;
					}
					if (arr[2] > arr[2 + 1]) {
						var temp = arr[2];
						arr[2] = arr[2 + 1];
						arr[2 + 1] = temp;
					}
					if (arr[3] > arr[3 + 1]) {
						var temp = arr[3];
						arr[3] = arr[3 + 1];
						arr[3 + 1] = temp;
					}
				
			}

			console.log(arr)
			
			
			
		</script>


	</body>
</html>
